*(*(tempField)+next) = 0; /* put a 0 terminator on the result */
/* clean up */
DisposHandle(orderHandle);
DisposHandle(lsHandle);
/* return the result */
return tempField;
}
/* XFCN entry point */
pascal void main(paramPtr)
XCmdBlockPtr paramPtr;
{
/* Prepare to use globals */
RememberA0();
SetUpA4();
/* get the input container copy */
MoveHHi(paramPtr->params[0]);
HLock(paramPtr->params[0]);
theField = (Handle)paramPtr->params[0];
/* do the sort */
paramPtr->returnValue = DoSort();
/* clean up */
HUnlock (paramPtr->params[0]);
RestoreA4();
return;
}
-- part contents for card part 9
----- text -----
SortField version 1.2d8.c
Roger Brown
SortField is an XFCN that sorts the lines of any HyperCard container. The input is a container and the output is a sorted copy of the container data. Sorting is alphabetical.
There are many such XFCN's available. This one has three positive features: it's fast, there is no limit to the number of lines it can sort except for the limit to available memory at the time it is used, and the source code is included here.